<?php

use yii\helpers\Url;
use yii\widgets\LinkPager;

$this->title = '微信账号管理';
$this->params['breadcrumbs'][] = ['label' => $this->title];
?>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>查询</h5>
                </div>
                <div class="ibox-content">
                    <form action="" method="get" class="form-inline" role="form" id="form">
                        <div class="form-group">
                            <label for="account" class="sr-only">微信号</label>
                            <input type="text" placeholder="请输入微信号" id="account"  value="<?= $account ?>" name="account" class="form-control">
                        </div>
                        <button class="btn btn-primary" type="submit">搜素</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>微信号信息</h5>
                    <div class="ibox-tools">
                        <a class="btn btn-primary btn-xs" href="<?= Url::to(['edit']) ?>">
                            <i class="fa fa-plus"></i>  新增微信号
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>微信号</th>
                                <th>二维码</th>
                                <th>渠道标识</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($models as $model) { ?>
                                <tr>
                                    <td><?= $model->id ?></td>
                                    <td><?= $model->account ?></td>
                                    <td><img src="<?= $model->qrcode ?>" width="60" height="60"></td>
                                    <td><?=$model->channel?></td>
                                    <td>
                                        <a href="<?= Url::to(['edit', 'id' => $model->id]) ?>"><span class="btn btn-info btn-sm">编辑</span></a>&nbsp
                                        <a href="<?= Url::to(['delete', 'id' => $model->id]) ?>"  onclick="rfDelete(this);return false;"><span class="btn btn-warning btn-sm">删除</span></a>&nbsp
                                    </td>
                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                    <div class="row">
                        <div class="col-sm-12">
                            <?=
                            LinkPager::widget([
                                'pagination' => $pages,
                                'maxButtonCount' => 5,
                                'firstPageLabel' => "首页",
                                'lastPageLabel' => "尾页",
                                'nextPageLabel' => "下一页",
                                'prevPageLabel' => "上一页",
                            ]);
                            ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
